function extract_spatial_subset, points, xmax, xmin, ymax, ymin, bounds=bounds, radius=radius
	if arg_present(bounds) then return, extract_spatial_subsetb(points, bounds)
	if arg_present(bounds) then return, extract_spatial_subsetb(points, xmax, xmin, radius)
	if arg_present(bounds) then return, extract_spatial_subsetb(points, xmax, xmin, edsize)

	valid = bytarr(n_elements(points[0,*]))
	valid[*]=0

	valid[where(points[0,*] gt xmin)] += 1
	valid[where(points[0,*] lt xmax)] += 1
	valid[where(points[1,*] gt ymin)] += 1
	valid[where(points[1,*] lt ymax)] += 1

	return, where(valid eq 4)
end

function extract_spatial_subsetb, points, bounds
	return, extract_spatial_subset(points, bounds[1], bounds[0], bounds[3], bounds[2])
end

function extract_spatial_subsetc, points, xcent, ycent, radius

end

function extract_spatial_subsets, points, xcent, ycent, edsize
	return, extract_spatial_subset(points, xcent + edsize, xcent - edsize, ycent + edsize, ycent- edsize)
end